package IC.lir.instructions;

import java.util.Iterator;

public class VirtualCallInstruction extends CallInstruction {
	
	private Immediate offset;
	private Register location;
	
	//C'tor
	public VirtualCallInstruction(Register location, Immediate offset, Register dst) {
		super(dst);
		this.offset = offset;
		this.location = location;
	}
	
	@Override
	public String toString() {
		StringBuffer s = new StringBuffer();
		s.append("VirtualCall " + location + "." + offset + "(");
		for (Iterator<Pair> iter = Arguments.iterator(); iter.hasNext(); ) {
			s.append(iter.next());
			if (iter.hasNext())
				s.append(", ");
		}
		s.append(")," + r);
		return s.toString();
	}

}